<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

$factory->define(\App\Models\User\SystemUser::class, function (Faker $faker) {
    return [
        'nickname' => $faker->name,
        'username' => $faker->name,
        'phone' => $faker->unique()->phoneNumber,
        'email' => $faker->unique()->safeEmail,
        'password' => bcrypt(123456), // password
        'avatar_url' => $faker->imageUrl(),
        'gender' => rand(1,2),
        'parent_id' => rand(1,999),
        'remark' => $faker->text(120),
        'longitude' => $faker->longitude,
        'latitude' => $faker->latitude,
        'remember_token' => Str::random(10),
    ];
});
